<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商户列表</title>
<link href="../style/css_member.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/common.js"></script>
<script src="../js/artDialog.js?skin=gray"></script>
<script src="../js/artDialog.iframeTools.js"></script>
<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script language="javascript" type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">

	function searchMember(){

		$("#memeber_list_form").submit();
	}

	/******修改状态 *****/
	function changeState(id,status){
		if(status == '3'){
			if (window.confirm("确认删除此商户？")) {
				var curPage = $("#curPage").val();
				var actionUrl =  "${ctx }/security/user!changeState.do?userId="+id+"&curPage="+curPage+"&operateStr="+status;

				window.location.href = actionUrl ;
			}
		}else{
			var curPage = $("#curPage").val();
			var actionUrl =  "${ctx }/security/user!changeState.do?userId="+id+"&curPage="+curPage+"&operateStr="+status;

			window.location.href = actionUrl ;
		}
	}

	$(function(){
		$("a[name='modifyHref']").click(function(){
			var id = $(this).attr("title");
			art.dialog.open('${ctx}/security/user!edit.do?id='+id,{title:'修改商户信息',width:800,height:550,lock:true},false);
	    });

		m2('m1_008','m1_008_01');
	});

</script>
</head>
<body>

<jsp:include page="/commons/head_member.jsp"></jsp:include>

<form action="${ctx }/security/user!listMember.do" method="post" id="memeber_list_form" name="memeber_list_form">
	<div style="border: 1px solid #ccc;margin:0 auto;background: #fff;padding-top: 10px;width: 960px;">
   		<table width="900" border="0" cellspacing="0" cellpadding="0" align="center" style="margin: 0 auto;">
            <tr>
              <td  colspan="100%" style="padding-left: 10px;padding-top:10px;font-family: 宋体;font-size: 12px;">开始时间： <input name="startDate" type="text" size="15" onClick="WdatePicker()" value="<fmt:formatDate value='${startDate }' pattern='yyyy-MM-dd'/>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              		结束时间： <input name="endDate" type="text" size="15" onClick="WdatePicker()"  value="<fmt:formatDate value='${endDate }' pattern='yyyy-MM-dd'/>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       				会  员：  <input name="filterTxt" value="username" type="hidden"/>
					<input name="filterValue" type="text" size="15" value="${filterValue }"/>
                  <img src="../images/an25.gif" width="50" height="21" style="cursor: pointer;vertical-align: middle;" onclick="searchMember();">
                </td>
            </tr>
            <tr><td height="10"></td></tr>
            <tr>
              <td colspan="100%"><table width="100%" class="tbl" cellpadding="0" cellspacing="0" align="center">
                  <tr bgcolor="#CDE1ED">
                    <td height="35">序号</td>
                    <td>商户姓名</td>
                    <td>角色</td>
                    <td>注册时间</td>
                    <td>审核状态</td>
                    <td>审核/编辑</td>
                    </tr>
                <c:forEach items="${page.result}" var="userInfo" varStatus="status">
                  <tr bgcolor="#FFFFFF">
                    <td height="30">${status.count }</td>
                    <td>${userInfo.username }</td>
                    <td>	
                    		<c:forEach var="role" items="${userInfo.roles}">
							  ${role.descn }&nbsp;&nbsp;	
							</c:forEach>
					</td>
                    <td><fmt:formatDate value='${userInfo.registerTime }' pattern='yyyy-MM-dd HH:mm:ss'/></td>
                    <td>${userInfo.userState.name }</td>
                    <td>
	                     <a style="color: blue;cursor: pointer" href="javascript:changeState(${userInfo.id },'1')">通过</a>&nbsp;
	                     <a style="color: blue;cursor: pointer" href="javascript:changeState(${userInfo.id },'2')">不通过</a>&nbsp;
	                     <a name="modifyHref" style="color: blue;cursor: pointer" title="${userInfo.id }">修改</a>&nbsp;
	                     <a style="color: blue;cursor: pointer" href="javascript:changeState(${userInfo.id },'3')">删除</a>
                     </td>
                    </tr>
                 </c:forEach>
              </table></td>
            </tr>
           <tr>
				<td colspan="100%" class="nw12a">
					<div align="right"><jsp:include page="/commons/paging_footer.jsp"/></div>
				</td>
		  </tr>
  </table>
 </div>
</form>

<jsp:include page="/commons/foot.jsp"></jsp:include>

</body>
</html>